﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sun
{
    public partial class FrmUser : Form
    {
        public FrmUser()
        {
            InitializeComponent();
        }

        private void FrmUser_Load(object sender, EventArgs e)
        {
            MyDeils();
             
        }
        private List<Student> MyDeils()
        {
            //DataTable dt = new DataTable("个人简历");
            //dt.Columns.Add("ID",typeof(int));
            //dt.Columns.Add("名字", typeof(string));
            //dt.Columns.Add("性别", typeof(char));
            //dt.Columns.Add("年龄", typeof(int));
            //dt.Columns.Add("城市", typeof(string));
            //dt.Columns.Add("数据", typeof(decimal));
            //dt.Columns.Add("时间", typeof(DateTime));
            //dt.Columns.Add("其他", typeof(string));

            //dt.Rows.Add(new object[] { 1, " Jack", '男', 18, "北京",-58.3,"2015-5-17","###" });
            //dt.Rows.Add(new object[] { 2, " cm", '女', 18, "纽约", - 48.3, "2015-6-17", "###" });
            //dt.Rows.Add(new object[] { 3, " dng", '女', 18, "首尔", - 38.3, "2015-7-17", "###" });
            //dt.Rows.Add(new object[] { 4, " doufile", '男', 18, "上海", - 28.3, "2015-8-17", "###" });
            //dt.Rows.Add(new object[] { 5, " Kobe", '男', 18, "长沙", - 88.3, "2015-9-17", "###" });


            List<Student> list = DAL.SelectAllStudent();
            //绑定DataTable 
            gridControl1.DataSource = list;
            
            //绑定DataSet 
            //gridControl1.DataSource = dt; 
            //gridControl1.DataMember = "表名";
            return list;

        }

    }
}
